<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>编辑报表</title>
<link href="/css/css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://pic2.58.com/n/tuan/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/javascript/jquery.form.js"></script>
<script type="text/javascript" src="/javascript/irreportcheck.js"></script>
</head>

<body>
<div class="lr_both">
<div class="right_conts">
  <div class="mg_tt">
    <div class="right_search">
      <div class="rs_title_bg">
        <h2 class="rs_title">编辑报表</h2>
      </div>
	  
    </div>
	</br>
	</br>
	<form id="updatereportform" name="updatereportform" action="/intreport/updatereport" method="post">
    <div class="table_div" align="center">
	  <input type="hidden" id="searchcount" name="searchcount" value="${searchConfigList.size()}"/>
	  <input type="hidden" id="drillcount" name="drillcount" value="${drillConfigList.size()}"/>
	  <input type="hidden" id="colcount" name="colcount" value="${columnList.size()}"/>
	  <input type="hidden" id="selectValue" name="selectValue" value="$!{selectValue}"/>
	  <input type="hidden" id="dpValues" name="dpValues" value="$!{dpValues}"/>
	  
      <table class="sj_tl"  width="90%" border="0" cellspacing="0" cellpadding="0">
		<tr>
          <th align="center" colspan="2">报表基本信息</th>
		</tr>
		
		<input type="hidden"   name="reportBaseInfo" id="reportBaseInfo" value="${report.id}"/>
        <tr>
           <td align="center" >名称</td>
		   <td align="center"  >
			<input style="width:280px" type="text"  name="reportBaseInfo" id="reportBaseInfo" value="${report.reportName}"/>
		   </td>
        </tr>
		<tr>
           <td align="center" >查询数据库</td>
		   <td align="center" >
			<select size="1"  name="reportBaseInfo" id="reportBaseInfo">
    		   #foreach($db in $dbList)
    			<option value="$db.id" 	#if(${report.DBconfig} == $db.id) selected #end >
						${db.cname}(${db.ename})
				</option>
			   #end
            </select>
		   </td>
        </tr>
		
		<tr>
           <td align="center">查询表名</td>
		   <td align="center" >
			<input type="text" style="width:280px" name="reportBaseInfo" id="reportBaseInfo" value="$!{report.tableName}"/>
		   </td>
        </tr>
		
		<tr>
           <td align="center">所属类别1</td>
		   <td align="center" >
			<input type="text"  style="width:280px" name="reportBaseInfo" id="reportBaseInfo" value="$!{report.reportCate1}"/>
		   </td>
        </tr>
		
		<tr>
           <td align="center">所属类别2</td>
		   <td align="center" >
			<input type="text"  style="width:280px" name="reportBaseInfo" id="reportBaseInfo" value="$!{report.reportCate2}"/>
		   </td>
        </tr>
		
		<tr>
           <td align="center">报表模板类型</td>
		   <td align="center" >
			<select size="1" style="width:286px"  name="reportBaseInfo" id="reportBaseInfo">
    			<option value="1" #if(${report.templateType}==1)  selected #end>1.查询指标全显示</option>
				<option value="2" #if(${report.templateType}==2)  selected #end>2.查询指标勾选式</option>
            </select>
		   </td>
        </tr>
		
		<tr>
           <td align="center">详细描述</td>
		   <td align="center" >
			<textarea style="width:280px;height:60px"  name="reportBaseInfo" id="reportBaseInfo" >
			 $!{report.description}
			</textarea>
		   </td>
        </tr>
		
		<tr>
           <td align="center">是否支持跨月查询</td>
		   <td align="center" >
			<input type="radio" name="isMonthSearch" value="1" #if($!{report.isMonthSearch} == "1") checked #end>是  
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input type="radio" name="isMonthSearch" value="0" #if($!{report.isMonthSearch} == "0") checked #end>否
		   </td>
        </tr>
	 </table>
	 
		</br>
		
	 <table id="searchcontable" name="searchcontable" class="sj_tl"  width="90%" border="0" cellspacing="0" cellpadding="0">
		<tr>
           <th align="center" colspan="5">
			筛选条件配置
			<input style="float:right;" type="button" onclick="addSearchRow();" value="新增行"/>
			<input style="float:right;" type="button" onclick="delTableAllRow('searchcontable');" value="删除所有行"/>
		   </th>
		  </th>
		</tr>
		
		#foreach($sc in $searchConfigList)
		#set($searchName = "searchInfo"+$velocityCount)
		#set($megName = "searchmsg"+$velocityCount)
		<tr >
		   <td >
			查询类型
			<select size="1"  name="$searchName" id="$searchName" onchange="searchCue('$searchName')">
    		   #foreach($searchType in $searchTypeList)
    			<option value="$searchType.id" #if(${searchType.id} == ${sc.searchTypeId}) selected #end>${searchType.name}</option>
			   #end
            </select>
		   </td>
		   
		   <td >
			查询绑定字段（英）
			<input type="text" style="width:120px" name="$searchName" id="$searchName" value="$!{sc.sename}"/>
		   </td>
		   
		   <td >
			查询条件中文名
			<input type="text" style="width:120px" name="$searchName" id="$searchName" value="$!{sc.scname}"/>
		   </td>
		   
		   <td >
			<div id="$megName">更多</div>
			<input type="text" style="width:350px"  name="$searchName" id="$searchName"  value="$!{sc.detailValue}"/>
		   </td>
		   <td >
			<input type="button"  value="删除"  onclick="delSearchCol(this)"/>
           </td>
        </tr>
		#end
      </table>
	  
	  </br>

      <table id="drillcontable" name="drillcontable" class="sj_tl"  width="90%" border="0" cellspacing="0" cellpadding="0">
		<tr>
           <th align="center" colspan="5">
			钻取配置
			<input style="float:right;" type="button" onclick="addDrillRow();" value="新增行"/>
			<input style="float:right;" type="button" onclick="delTableAllRow('drillcontable');" value="删除所有行"/>
		   </th>
		  </th>
		</tr>
		
		#foreach($sc in $drillConfigList)
		#set($drillName = "drillInfo"+$velocityCount)
		<tr >   
		   <td >
			钻取字段(英)
			<input type="text" style="width:120px" name="$drillName" id="$drillname" value="$!{sc.drillname}"/>
		   </td>
		   
		   <td >
			关联字段(英)
			<input type="text" style="width:120px" name="$drillName" id="$drillName" value="$!{sc.replayname}"/>
		   </td>
		   <td >
			<input type="button"  value="删除"  onclick="delDrillCol(this)"/>
           </td>
        </tr>
		#end
      </table>
	  
	  </br>


	 <table class="sj_tl"  width="90%" border="0" cellspacing="0" cellpadding="0">
		<tr>
           <th align="center">
			查询指标分组标签配置
			<input style="float:right;" type="button" onclick="addTabGrp(this);" value="新增组名"/>
			<input style="float:right;" type="text"/>
		   </th>
		</tr>
		<tr>
           <td align="left">
           <input type="hidden" name="tabGrpVal" id="tabGrpVal" value="$strTabName"/>
           #foreach($tabname in $tabNameList)
           <span name="tabName" id="tabName" val="$tabname" onDblClick="dbClick(this)">
			$tabname
			&nbsp;&nbsp;&nbsp;
			<input type="button" onclick="delTabGrp(this);" value="删除"/>
			&nbsp;&nbsp;&nbsp;
			</span>
			#end
		   </td>
		</tr>
      </table>
      
	  </br>
	 <table id="colconfigtable" name="colconfigtable" class="sj_tl"  width="90%" border="0" cellspacing="0" cellpadding="0">
		<tr>
           <th align="center" colspan="8">
			查询指标配置
			<input style="float:right;" type="button" onclick="addColRow();" value="新增行"/>
			<input style="float:right;" type="button" onclick="delTableAllRow('colconfigtable');" value="删除所有行"/>
		   </th>
		  </th>
		</tr>
		
		#foreach($col in $columnList)
		#set($colName = "colinfo"+$velocityCount)
		<tr >
		   <td >
			数据库字段（英）
			<input type="text" style="width:160px" name="$colName" id="$colName" value="${col.ename}"/>
		   </td>
		   
		   <td >
			字段中文名
			<input type="text" style="width:200px" name="$colName" id="$colName" value="${col.cname}"/>
		   </td>
		   <td>
			类别标签
			<select style="width:70px" info="tabType" size="1"  name="$colName" id="$colName">
				#foreach($tabname in $tabNameList)
					<option value="$tabname" #if(${col.tabType} == $tabname) selected #end>$tabname</option>
				#end
            </select>
		   </td>
		   <td >
			计算公式（不填则默认字段本身）
			<input type="text" style="width:200px"  name="$colName" id="$colName"  value="${col.specialInSql}"/>
		   </td>
		   
		   <td >
			字段类型
			<select size="1"  name="$colName" id="$colName">
    			<option value="0" #if(${col.colType} == 0) selected #end>字符</option>
				<option value="1" #if(${col.colType} == 1) selected #end>整型</option>
				<option value="2" #if(${col.colType} == 2) selected #end>浮点</option>
				<option value="3" #if(${col.colType} == 3) selected #end>百分比</option>
            </select>
		   </td>
		   
		   <td >
			支持排序
			<select size="1"  name="$colName" id="$colName">
    			<option value="0" #if(${col.isOrderBy} == 0) selected #end>否</option>
				<option value="1" #if(${col.isOrderBy} == 1) selected #end>是</option>
            </select>
		   </td>
		   
		   <td >
			<input type="button"  value="删除"  onclick="delColConfig(this)"/>
           </td>
        </tr>
		#end
      </table>
	  
	  
	  </br>
	  <table class="sj_tl"  width="90%" border="0" cellspacing="0" cellpadding="0">
	  <tr>
          <th align="center" colspan="2">
            <input type="button"   id="update" name="update" value="更新"/>
			&nbsp;	&nbsp;	&nbsp;	&nbsp;	&nbsp;	&nbsp;	&nbsp;	&nbsp;
			<input type="reset"    value="重置"/>
		  </th>
		</tr>
      </table>
    </div>
	</form>
  </div>

</div>
</div>
</body>
</html>
